package com.example.springiocdi20231209.springiocdi20231209;

import com.example.springiocdi20231209.springiocdi20231209.Controller.User;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class BeanConfig {
    @Bean("u1")
    public User user() {
        User user = new User();
        user.setName("zhangsan");
        user.setAge(18);
        return user;
    }

    @Bean({"u2", "s2"})
    public User user2() {
        User user = new User();
        user.setName("liis");
        user.setAge(20);
        return user;
    }
}
